//
//  WFDesignerDetailCell.m
//  谷居
//
//  Created by dllo on 16/7/1.
//  Copyright © 2016年 刘万方. All rights reserved.
//

#import "WFDesignerDetailCell.h"

@implementation WFDesignerDetailCell

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createCell];
    }
    return self;
}

- (void)createCell {
    _baseView = [[WFUIView alloc] init];
    [self.contentView addSubview:_baseView];
    [_baseView release];
    
    
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    _baseView.frame = CGRectMake(0, 0, self.contentView.frame.size.width, self.contentView.frame.size.height);
    _baseView.backgroundColor = [UIColor redColor];
    
#pragma mark - 创建tableView
    [self createTableView];

}

/** 创建tableView. */
- (void)createTableView {
    _caseTableView = [[WFTableView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, self.contentView.frame.size.height)];
    [_baseView addSubview:_caseTableView];
    [_caseTableView release];
    
    _caseTableView.delegate = self;
    _caseTableView.dataSource = self;
    
    _caseTableView.separatorStyle = 1;
    _caseTableView.rowHeight = 250;
    NSLog(@"创建他不leView");
    
//    _caseTableView.bounces = NO;
//    _caseTableView.userInteractionEnabled = NO;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 10;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *reuse = @"caseDetail";
    WFCaseCell *cell = [tableView dequeueReusableCellWithIdentifier:reuse];
    if (!cell) {
        cell = [[WFCaseCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:reuse];
    }
    if (indexPath.row == 0) {
        cell.userInteractionEnabled = NO;
    }
    return cell;
}

- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
    
    NSLog(@"caseCellcontenetSEt: %f", _caseTableView.contentOffset.y);
//    if (_caseTableView.contentOffset.y < ) {
//        <#statements#>
//    }
    [self.desDelegate makeMainCellScrollWithY:_caseTableView.contentOffset.y ScrollView:scrollView];
}
@end
